package com.haha.Controllers;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@Controller
@RequestMapping("/hello")
public class HelloworldController {
    @GetMapping("/helloworld")
    @ResponseBody   // Spring会自动处理方法的返回值，将其转换为HTTP响应的内容
    public String Hello(){
        return "Hello, world!";
    }
}
